package com.km.sglototo.sys.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.km.sglototo.sys.entity.TbWorklog;
import com.km.sglototo.sys.service.TbWorklogService;
import com.km.sglototo.utils.CommonResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author xt
 * @since 2022-04-27
 */
@RestController
@RequestMapping("/worklog")
public class TbWorklogController {

    @Resource
    private TbWorklogService tbWorklogService;
    @GetMapping(value = "/list")
    public Object getDictList(TbWorklog id, @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                              @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize){
        QueryWrapper<TbWorklog> queryWrapper = new QueryWrapper<>();
//        if(id.getOrgid() != null){
//            queryWrapper.like("orgid",id.getOrgid());
//        }
//        if(id.getIsable() != null){
//            queryWrapper.like("isable",id.getIsable());
//        }
//        if(id.getWorkdate() != null){
//            queryWrapper.like("workdate",id.getWorkdate());
//        }
        Page p = new Page<TbWorklog>(pageNum, pageSize);
        return new CommonResult().success(tbWorklogService.page(p, queryWrapper));
    }





}

